<?php
/**
*
* @package - SaveKb Mod
* @version $Id: acp_savekb.php 2 2010-01-24 09:04:01Z allytools $
* @copyright (c) Pionier ( http://www.allytools.de/ )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

if (!defined('IN_PHPBB')) 
{ 
	exit; 
}

class acp_savekb
{
	var $u_action;

	function main($id, $mode)
	{
		global $db, $user, $auth, $template, $cache;
		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;

		add_form_key('savekb');

		$user->add_lang('acp/common');
		$user->add_lang('mods/acp_savekb');
		$user->add_lang('ucp');
		$this->tpl_name = 'acp_savekb';
		$this->page_title = $user->lang['ACP_SAVEKB_MANAGEMENT'];
		$submit = (isset($_POST['submit'])) ? true : false;

		if ($submit)
		{
			if (!check_form_key('savekb'))
			{
				trigger_error('FORM_INVALID');
			}

			set_config('savekb_on', request_var('savekb_on', 0));
			set_config('savekb_uni', request_var('savekb_uni', 0));
			set_config('savekb_limit', request_var('savekb_limit', 0));
            
            add_log('admin', 'LOG_SAVEKB_SETTINGS');
            $error = $user->lang['ACP_SAVEKB_SETTINGS_UPDATED'];
			trigger_error($user->lang['SAVEKB_SAVED_SETTINGS'] . adm_back_link($this->u_action));
		}
        
        $template->assign_vars(array(
			'SAVEKB_MOD_RELEASE'		=> sprintf($user->lang['ACP_SAVEKB_COPY'], $config['savekb_version']),
			'SAVEKB_ON'			        => $config['savekb_on'],
			'SAVEKB_UNI'	    	    => $config['savekb_uni'],
			'SAVEKB_LIMIT'  		    => $config['savekb_limit'],
			'U_ACTION'				    => $this->u_action,
		));
	}

}

?>